"""
flask server
"""

from flask import Flask, jsonify
from server_class import ServerClass # 导入你的 main.py

app = Flask(__name__)

@app.route('/helloworld', methods=['POST'])
def run_test():
    basic = ServerClass()  # 初始化需要的对象
    basic.testServer() # 调用函数
    return jsonify({"status": "success"})

@app.route('/run-retrieve-fireworks', methods=['POST'])
def run_retrieve_fireworks():
    basic = ServerClass()  # 初始化需要的对象
    basic.retrieveFireworks()  # 调用函数
    return jsonify({"status": "success"})

@app.route('/run-main-line-upgrade', methods=['POST'])
def run_main_line_upgrade():
    basic = ServerClass()  # 初始化需要的对象
    basic.mainLineUpgrade()  # 调用函数
    return jsonify({"status": "success"})

if __name__ == '__main__':
    app.run(debug=True)